package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.net.mapper.BusiL2VpnQosflowMapper;
import com.ruoyi.net.domain.BusiL2VpnQosflow;
import com.ruoyi.net.service.IBusiL2VpnQosflowService;

/**
 * 业务-L2 VPN qos流量监管Service业务层处理
 * 
 * @author net
 * @date 2024-12-15
 */
@Service
public class BusiL2VpnQosflowServiceImpl implements IBusiL2VpnQosflowService 
{
    @Autowired
    private BusiL2VpnQosflowMapper busiL2VpnQosflowMapper;

    /**
     * 查询业务-L2 VPN qos流量监管
     * 
     * @param id 业务-L2 VPN qos流量监管主键
     * @return 业务-L2 VPN qos流量监管
     */
    @Override
    public BusiL2VpnQosflow selectBusiL2VpnQosflowById(String id)
    {
        return busiL2VpnQosflowMapper.selectBusiL2VpnQosflowById(id);
    }

    /**
     * 查询业务-L2 VPN qos流量监管列表
     * 
     * @param busiL2VpnQosflow 业务-L2 VPN qos流量监管
     * @return 业务-L2 VPN qos流量监管
     */
    @Override
    public List<BusiL2VpnQosflow> selectBusiL2VpnQosflowList(BusiL2VpnQosflow busiL2VpnQosflow)
    {
        return busiL2VpnQosflowMapper.selectBusiL2VpnQosflowList(busiL2VpnQosflow);
    }

    /**
     * 新增业务-L2 VPN qos流量监管
     * 
     * @param busiL2VpnQosflow 业务-L2 VPN qos流量监管
     * @return 结果
     */
    @Override
    public int insertBusiL2VpnQosflow(BusiL2VpnQosflow busiL2VpnQosflow)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(busiL2VpnQosflow.getId())) {
            busiL2VpnQosflow.setId(uuid);
        }
        busiL2VpnQosflow.setCreateBy(SecurityUtils.getUsername());
        busiL2VpnQosflow.setCreateTime(DateUtils.getNowDate());
        busiL2VpnQosflow.setUpdateBy(SecurityUtils.getUsername());
        busiL2VpnQosflow.setUpdateTime(DateUtils.getNowDate());
        return busiL2VpnQosflowMapper.insertBusiL2VpnQosflow(busiL2VpnQosflow);
    }

    /**
     * 修改业务-L2 VPN qos流量监管
     * 
     * @param busiL2VpnQosflow 业务-L2 VPN qos流量监管
     * @return 结果
     */
    @Override
    public int updateBusiL2VpnQosflow(BusiL2VpnQosflow busiL2VpnQosflow)
    {
        busiL2VpnQosflow.setUpdateBy(SecurityUtils.getUsername());
        busiL2VpnQosflow.setUpdateTime(DateUtils.getNowDate());
        return busiL2VpnQosflowMapper.updateBusiL2VpnQosflow(busiL2VpnQosflow);
    }

    /**
     * 批量删除业务-L2 VPN qos流量监管
     * 
     * @param ids 需要删除的业务-L2 VPN qos流量监管主键
     * @return 结果
     */
    @Override
    public int deleteBusiL2VpnQosflowByIds(String[] ids)
    {
        return busiL2VpnQosflowMapper.deleteBusiL2VpnQosflowByIds(ids);
    }

    /**
     * 删除业务-L2 VPN qos流量监管信息
     * 
     * @param id 业务-L2 VPN qos流量监管主键
     * @return 结果
     */
    @Override
    public int deleteBusiL2VpnQosflowById(String id)
    {
        return busiL2VpnQosflowMapper.deleteBusiL2VpnQosflowById(id);
    }
}
